package model.vo
{
	import com.google.maps.LatLng;
	
	import utils.DialogUtil;

	public class DeviceVO
	{
		/**
		 *  经纬度
		 **/
		public var latitude:String; 
		public var longitude:String; 		
		public var speed:String; 		
		public var status_text:String;
		public var nickname:String;
		public var sn:String;
		public var dateline:String;		
		public var direction:String;
		private var xmlData:Object ;
		
		public function DeviceVO( xmlData:Object )
		{
			try{
				this.xmlData = xmlData;
				this.latitude=xmlData.position.map.latitude;
				this.longitude=xmlData.position.map.longitude;
				this.speed=xmlData.position.map.speed;
				this.direction=xmlData.position.map.direction;
				this.status_text=xmlData.position.map.status_text;
				this.dateline = xmlData.position.map.dateline;
				this.nickname=xmlData.nickname;
				this.sn=xmlData.sn;		
			}catch(e:Error){
				/***
				 *  MAPER-47
				 *  暂时显示数据异常
				 *  @Time: 2012 10:50:59 PM 
				 **/ 
				//DialogUtil.openError("所选择的设备有返回异常的信息，请检查设备的有效性。", "错误");
			}
			
		}
		
		public function getLatLng():LatLng
		{
			return  new LatLng(Number(this.latitude), Number(this.longitude));
		}
	}
}